function log(target: any, key: string, descriptor: PropertyDescriptor) {
  console.log(descriptor);
  const oldValue = descriptor.value; // business 函数
  console.log(oldValue);

  // 重新定义 business 函数
  descriptor.value = function () {
    console.log(`记录日志...`);
    return oldValue.apply(this, arguments);
  };
}

class Business {
  @log // 不影响业务功能的代码，只加 log 的 “切面”
  business() {
    console.log("业务功能");
  }
}

const bs = new Business();
bs.business();
